VERSION=0.4
CFLAGS=-O2 -mno-cygwin --std=gnu99 -Wall -Wextra -DCM_VERSION=\"$(VERSION)\"
LDFLAGS=-mno-cygwin

OBJS=clearmerge.o amlicence.o

clearmerge: $(OBJS)
	$(CC) $(LDFLAGS) -o $@ $^ -ladvapi32
	strip $@

installer: clearmerge
	sed "s/^\!define VERSION .*/\!define VERSION $(VERSION)/" installer.nsi > installer-tmp.nsi
	makensis installer-tmp.nsi
	rm installer-tmp.nsi

clean:
	rm -f $(OBJS)
	
distclean: clean
	rm -f clearmerge.exe 

.PHONY: installer clean distclean

